package dongze.com.ckdj.databinding.model;

import android.databinding.BaseObservable;
import android.databinding.Bindable;

import java.util.ArrayList;
import java.util.List;

import dongze.com.ckdj.BR;
import dongze.com.ckdj.databinding.BindingUtil;

/**
 * Created by fanqwz on 2017/7/20.
 */

public class InformationItemPhotoModel extends BaseObservable {
    String key;
    String hint;
    List<String> imgs = new ArrayList<>(20);

    public InformationItemPhotoModel() {
    }

    @Bindable
    public String getHint() {
        return hint;
    }

    public void setHint(String hint) {
        if (BindingUtil.isNotEqual(this.hint, hint)) {
            this.hint = hint;
            notifyPropertyChanged(dongze.com.ckdj.BR.hint);
        }
    }

    int keyColor = 0xFF0000FF;
    int valueColor = 0xFF000000;

    @Bindable
    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
        notifyPropertyChanged(dongze.com.ckdj.BR.key);
    }

    @Bindable
    public int getKeyColor() {
        return keyColor;
    }

    public void setKeyColor(int keyColor) {
        this.keyColor = keyColor;
        notifyPropertyChanged(dongze.com.ckdj.BR.keyColor);
    }

    @Bindable
    public int getValueColor() {
        return valueColor;
    }

    public void setValueColor(int valueColor) {
        this.valueColor = valueColor;
        notifyPropertyChanged(dongze.com.ckdj.BR.valueColor);
    }

    @Bindable
    public List<String> getImgs() {
        return imgs;
    }

    public void setImgs(List<String> imgs) {
        if (imgs == this.imgs)
            return;

        this.imgs = imgs;
        notifyPropertyChanged(BR.imgs);

        if (imgs != null && imgs.size() > 0)
            setHint("已拍摄" + imgs.size() + "张图片");
        else
            setHint("没有图片，最多可拍20张图片");

    }
}
